package com.leha.apidemo.service.impl;


import com.leha.apidemo.Utils.APIErrorDict;
import com.leha.apidemo.service.ErrorMessageUtils;
import org.springframework.stereotype.Service;

/**
 * Created by xiabin on 2017/7/26.
 */
@Service
public class ErrorMessageUtilsImpl implements ErrorMessageUtils {

    private ThreadLocal<APIErrorDict> lastError = new ThreadLocal<APIErrorDict>();

    @Override
    public APIErrorDict getLastError() {
        return lastError.get();
    }

    @Override
    public void setError(APIErrorDict error) {
        lastError.set(error);
    }
}
